﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities;
using Abp.Organizations;
using DualControl.Authorization.Roles;
using DualControl.Authorization.Users;
using DualControl.Common;
using DualControl.HazardSources;

namespace DualControl.ControlMeasures
{
    /// <summary>
    /// 管控措施，同时作为隐患排查的现场排查要求
    /// </summary>
    public class ControlMeasure:Entity, IMustHaveTenant
    {    
        
        //部门
        public long OrganizationUnitId { get; set; }
        //风险点编号

        public int RiskPointId { get; set; }

        //风险源编号
        public int HazardSourceId { get; set; }

        //风险级别 ，根据级别，制订排查规则
        public RiskLevel? RiskLevel { get; set; }
        
        
        ////负责人 部门的负责人
        //[ForeignKey("User")]
        //public long? UserId { get; set; }



        //排查角色，可以不用，根据隐患级别可以确定隐患分级检查的级别
        //public int? RoleId { get; set; }

        //班组
        public long? TeamId { get; set; }


        //岗位
        public int? PostId { get; set; }    

        //类别：第一类(内因)  第二类 人 机 环境 管理缺陷四种
        public RiskFactorType? RiskFactorType { get; set; }       

        public string ControlContent { get; set; }

        //检查周期
        public CheckCycle? CheckCycle { get; set; }
        

        public int TenantId { get; set; }
        
        //导航属性
        //风险源  去掉，否则会引起循环引用，即这里引用HazardSource，HazardSource又引用ControlMeasure 
        //  public HazardSource HazardSource { get; set; }
        //部门
        public OrganizationUnit OrganizationUnit { get; set; }
        //责任人
        //public User User { get; set; }

       
    }
}
